﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Security.Cryptography.X509Certificates;

namespace XmlDSigEx
{
    class RSAX509Provider:SignatureProvider
    {
        public override bool CanHandle(XmlElement signatureElement)
        {
            string algorithm = GetAlgorithm(signatureElement);
            return algorithm == (RsaAlgorithm.URI_RSA_SHA1) || algorithm.StartsWith(RsaAlgorithm.URI_RSA_SHA2_PREFIX);
        }

        public override ISignatureAlgorithm GetSignatureAlgorithm(XmlElement signatureElement)
        {
            return new RSAX509Algorithm(signatureElement);
        }       
    }
}
